function checkForNew() {
	var messages = parentSandboxBridge.getTimeline();
	if (messages != null) {		
	//Display message
	document.getElementById('messages').innerHTML = messages;
	}
}

function init() {
	loggedin_identica = parentSandboxBridge.loggedInIdentica();
	loggedin_twitter = parentSandboxBridge.loggedInTwitter();

	if (loggedin_twitter == '1')
	{
		parentSandboxBridge.updateFriends(); 
		parentSandboxBridge.updateReplies();
		parentSandboxBridge.updateDirect();
		window.setInterval("parentSandboxBridge.updateFriends()", 180000);
		window.setInterval("parentSandboxBridge.updateReplies()", 180000);
		window.setInterval("parentSandboxBridge.updateDirect()",  240000);
	}
	if (loggedin_identica == '1')
	{
		parentSandboxBridge.updateFriends_identica(); 
		parentSandboxBridge.updateReplies_identica();
		window.setInterval("parentSandboxBridge.updateFriends_identica()", 180000);
		window.setInterval("parentSandboxBridge.updateReplies_identica()", 180000);
	}
	
	window.setTimeout("checkForNew()", 3000);
	window.setInterval("checkForNew()", 20000);
		
//TAE 2008.08.17 (start
	var interface = {};
	interface.checkForNew = function(){
			checkForNew();
	}
	
	window.childSandboxBridge = interface;
//TAE 2008.08.17 (end
}

function gotolink() {
	parentSandboxBridge.gotoURL(event.srcElement.name);
	return false;
}

function replyUsername() {
	parentSandboxBridge.insertReply(event.srcElement.name);
	return false;
}

//TAE 2008.08.20 (start
function dmUsername() {
	parentSandboxBridge.insertDM(event.srcElement.name);
	return false;
}
//TAE 2008.08.20 (end

//TAE 2008.08.22 (start
function gotoStatus(name, id) {
	var url = 'http://twitter.com/' + name +'/statuses/' + id;
	parentSandboxBridge.gotoURL(url);
	return false;
}

function gotoStatus_identica(name, id) {
	var url = 'http://identi.ca/notice/' + id;
	parentSandboxBridge.gotoURL(url);
	return false;
}

function gotoHashTag() {
	//var url = 'http://www.hashtags.org/tag/' + event.srcElement.name;
	var url = 'http://search.twitter.com/search?q=%23' + event.srcElement.name;
	parentSandboxBridge.gotoURL(url);
	return false;
}
//TAE 2008.08.22 (end
	
function gotoHashTag_identica() {
	var url = 'http://identi.ca/tag/' + event.srcElement.name;
	parentSandboxBridge.gotoURL(url);
	return false;
}